@extends('admin.container')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            REST_API: {
                get_supplier_list_url: "{{route('admin.merchant.index')}}", // 获取商家推荐列表数据,搜索
                del_supplier_list_url: "{{route('admin.merchant.batch-remove')}}", //删除
                get_logistics_list_url: "{{route('admin.logistics.index')}}", //获取物流公司列表数据,搜索
                del_logistics_list_url: "{{route('admin.logistics.batch-remove')}}", //删除物流公司
                add_logistics_company_url: "{{route('admin.logistics.create')}}",
                add_supplier_company_url: "{{route('admin.merchant.create')}}",
            }
        };
    </script>
@stop

@section('c-body')
    <div class="comm-title">
        <span class="title-msg">推荐位</span>
    </div>
    <div class="comm-body">
        <div class="am-btn-group" style="margin-top: 22px;">
            <button type="button" class="am-btn am-btn-primary am-btn-sm " id="business" code="0">
                <span style="width:90px;display:block;" code="0" >商家推荐</span>
            </button>
            <button type="button" class="am-btn am-btn-default am-btn-sm" id="logistics-company" code="1">
                <span style="width:90px;display:block;" code="1">物流公司</span>
            </button>
        </div>
        <a type="button" class="am-btn am-btn-success am-btn-xs add-btn" style="float: right;margin-right: 20px;margin-top: 22px;"  id="add_supplier">
            <span class="" style="width:100px;display:block;height: 16px">新增商家推荐</span>
        </a>
        <div class="tab-body business dn" style="display: block;">
            <div class="supplyList-screen mt20">
                <div class="supplyList-screen-main">
                    <div class="sl-screen-box">
                        <div>
                                    <span>
                                        商家名称：
                                    </span>
                            <input type="text" style="width: 200px;height: 30px;" id="supply_name">
                            <button id="search-btn" type="button" class="am-btn am-btn-success am-btn-xs ml10">搜索</button>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 表单列表 -->
            <div class="clearfix ">
                <table class="am-table am-table-striped am-table-hover am-table-centered brand-manage-tbl shopAdmin-list mt20">
                    <thead>
                    <tr>
                        <th style="width:5%">
                            <span style="visibility:hidden;">1</span>
                        </th>
                        <th>排序</th>
                        <th>供应商名称</th>
                        <th>推荐图片</th>
                        <th>栏目</th>
                        <th style="width:15%">操作</th>
                    </tr>
                    </thead>
                    <tbody class="shopAdmin-list-body" id="supplier-list-context">
                    </tbody>
                </table>
                <div class="tool-bar-bottom clearfix">
                    <div class="unit">
                        <input id="sel-all-chk" type="checkbox" class="mid" style="position: relative; top:13px;" />
                    </div>
                    <div class="unit">
                        <label for="sel-all-chk" style="cursor:pointer;font-weight:300;">全选</label>
                    </div>
                    <div class="unit">
                        <button id="del-supply-btn" type="button" class="am-btn am-btn-default am-btn-xs ml10 all-shield-btn" style="position: relative;float:left;top:5px;">删除</button>
                    </div>
                </div>
                <div id="comm-paging-0" class="admin-paging" current-page="1"></div>
            </div>
        </div>
        <div class="tab-body logistics-company dn" style="display: none">
            <!-- 表单列表 -->
            <div class="clearfix ">
                <table class="am-table am-table-striped am-table-hover am-table-centered brand-manage-tbl shopAdmin-list mt20">
                    <thead>
                    <tr>
                        <th style="width:5%">
                            <span style="visibility:hidden;">1</span>
                        </th>
                        <th>排序</th>
                        <th>物流公司名称</th>
                        <th>公司图标</th>
                        <th style="width:15%">操作</th>
                    </tr>
                    </thead>
                    <tbody class="shopAdmin-list-body" id="logistics-company-context">
                    </tbody>
                </table>
                <div class="tool-bar-bottom clearfix">
                    <div class="unit">
                        <input id="logistics-all-chk" type="checkbox" class="mid" style="position: relative; top:13px;" />
                    </div>
                    <div class="unit">
                        <label for="logistics-all-chk" style="cursor:pointer;font-weight:300;">全选</label>
                    </div>
                    <div class="unit">
                        <button id="del-logistics-btn" type="button" class="am-btn am-btn-default am-btn-xs ml10 all-shield-btn" style="position: relative;float:left;top:5px;">删除</button>
                    </div>
                </div>
                <div id="comm-paging-1" class="admin-paging" current-page="1"></div>
            </div>
        </div>
    </div>
    <script type="text/template" id="supplyListTemp">
        <%_.each(obj, function(item){%>
        <tr>
            <td class="sel-chk">
                <input type="checkbox" id="<%=item.id%>" />
            </td>
            <td>
                <%=item.sort%>
            </td>
            <td>
                <span class="tc" style="margin: 0 auto;margin-top: 10px"><%=item.name%></span>
            </td>
            <td>
                <img src="<%=item.img_url%>"  style="width:150px; height:50px;" />
            </td>
            <td>
                <%=item.column%>
            </td>
            <td style="width:15%">
                <div class="operate-btns-2 clearfix">
                    <a id="" type="button" class="edit-brand-btn am-btn am-btn-primary am-btn-xs" href="<%=item.edit_url%>" style="float:left;">编辑</a>
                    <button id="" type="button" class=" am-btn am-btn-default am-btn-xs del-btn" style="float:left; margin-left: 10px;" href="<%=item.del_url%>">删除</button>
                </div>
            </td>
        </tr>
        <%})%>
    </script>
    <script type="text/template" id="logistics-list-temp">
        <%_.each(obj, function(item){%>
        <tr>
            <td class="sel-chk">
                <input type="checkbox" id="<%=item.id%>" />
            </td>
            <td>
                <%=item.sort%>
            </td>
            <td>
                <span class="tc" style="margin: 0 auto;margin-top: 10px"><%=item.name%></span>
            </td>
            <td>
                <img src="<%=item.img_url%>">
            </td>
            <td style="width:15%">
                <div class="operate-btns-2 clearfix">
                    <a id="" type="button" class="edit-brand-btn am-btn am-btn-primary am-btn-xs" href="<%=item.edit_url%>" style="float:left;">编辑</a>
                    <button id="" type="button" class=" am-btn am-btn-default am-btn-xs del-btn" style="float:left; margin-left: 10px;" href="<%=item.del_url%>">删除</button>
                </div>
            </td>
        </tr>
        <%})%>
    </script>
    <script src="/assets/b2b/admin/js/pages/18-19.js"></script>
@stop